package com.example.springbootxscjxt.mapper;

import com.example.springbootxscjxt.entity.Score;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ScoreMapper {
@Select("select * from score")
    List<Score> selectall();
@Select("select * from score where studentName like concat('%',#{studentName},'%') limit #{pageNum}, #{pageSize} " )
    List<Score> select(String studentName,Integer pageNum,Integer pageSize);
    @Select("select count(*) from score where studentName like concat('%',#{studentName},'%')")
    Integer total(String studentName);
@Insert("insert into score(studentName,studentNo,score,type) VALUES (#{studentName},#{studentNo},#{score},#{type})")
    Integer add(Score score);
@Update("update score set studentName=#{studentName},studentNo=#{studentNo},score =#{score},type=#{type} where id=#{id} ")
    Integer updatescore(Score score);
@Delete("delete from score where id=#{id}")
    Integer scscore(String id);
@Select("select * from score where studentNo=#{studentNo}")
    List<Score> cxgrcj(String studentNo);
}
